<?php

class Trego_Filterproducts_Block_Featured_Home_List extends Trego_Filterproducts_Block_Featured_List
{
		protected function _getProductCollection()
    	{
            parent::__construct();
            $storeId    = Mage::app()->getStore()->getId();
            $storeCode  = Mage::app()->getStore()->getCode();
            $products = Mage::getModel('catalog/product')->getCollection()
                ->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')))
                ->addAttributeToSelect('*')
                ->addAttributeToSelect(array('name', 'price', 'small_image'))
                ->setStoreId($storeId)
                ->addStoreFilter($storeId);

            if(Mage::getStoreConfig('filterproducts/featured/max_product', $storeCode))
            {
                $products->setPageSize(Mage::getStoreConfig('filterproducts/featured/max_product'));
            }


            Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
            Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
            Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($products);

            $this->_productCollection = $products;

            return $this->_productCollection;
    	}
		
		function get_prod_count()
		{
			//unset any saved limits
	    	Mage::getSingleton('catalog/session')->unsLimitPage();
	    	return (isset($_REQUEST['limit'])) ? intval($_REQUEST['limit']) : 9;
		}// get_prod_count

		function get_cur_page()
		{
			return (isset($_REQUEST['p'])) ? intval($_REQUEST['p']) : 1;
		}// get_cur_page

    	function get_order()
		{
			return (isset($_REQUEST['order'])) ? ($_REQUEST['order']) : 'ordered_qty';
		}// get_order

    	function get_order_dir()
		{
			return (isset($_REQUEST['dir'])) ? ($_REQUEST['dir']) : 'desc';
		}// get_direction

		public function getToolbarHtml()
    	{
        
    	}
}